package com.chinacoal.microservice;

import com.primeton.eos.dap.sdk.api.bizflow.EnableSDKBizflows;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @author zhuliang
 * @version V1.0
 * @Description: 入口模块启动类
 * @date 2020-11-05 17：59
 */

@EnableScheduling
@SpringBootApplication
//@EnableFeignClients
//@EnableCircuitBreaker
//@EnableDiscoveryClient
@EnableSDKBizflows
@MapperScan("com.chinacoal.microservice.mapper")
//@ComponentScan(basePackages = {"com.chinacoal.microservice.*"})
public class BootApplication {

    public static void main(String[] args) {
        SpringApplication.run(BootApplication.class,args);
    }

//    @Bean
//    public FilterRegistrationBean corsFilter() {
//        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
//        CorsConfiguration config = new CorsConfiguration();
//        config.setAllowCredentials(true);
//        config.addAllowedOrigin("*");
//        config.addAllowedHeader("*");
//        config.addAllowedMethod("*");
//        source.registerCorsConfiguration("/**", config); // CORS 配置对所有接口都有效
//        FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
//        bean.setOrder(0);
//        return bean;
//    }
}
